package ru.teleology.cubefs.api.models;

import ru.teleology.cubefs.api.reflection.NativeType;
import ru.teleology.cubefs.api.reflection.Type;
import ru.teleology.cubefs.api.reflection.TypeSystem;
import ru.teleology.cubefs.api.reflection.Typed;
import ru.teleology.cubefs.api.reflection.Types;

@NativeType(name = Types.LOGGER_TYPE)
public class Logger extends Typed {

	private static final Type myType = TypeSystem.find(Types.LOGGER_TYPE);
	
	private Operations operations = (Operations) myType.proxy(this);
	
	public Logger(long handle) {
		super(handle, false);
	}
	
	public int GetLogLevel() {
		return operations.GetLogLevel();
	}
	
	public void SetLogLevel(int level) {
		operations.SetLogLevel(level);
	}
	
	public LogHandler GetLogHandler() {
		return operations.GetLogHandler();
	}
	
	public void SetLogHandler(LogHandler handler) {
		operations.SetLogHandler(handler);
	}

	public interface Operations {
		int GetLogLevel();
		void SetLogLevel(int level);
		LogHandler GetLogHandler();
		void SetLogHandler(LogHandler handler);
	}
}
